(module
  (import "env" "assert_eq_i64" (func $assert_eq_i64 (param i64 i64)))
  (start $main)
  (func $main (export "main")
    (call $assert_eq_i64 (call $calc (i32.const 0) (i64.const 30) (i64.const 20)) (i64.const 50))
    (call $assert_eq_i64 (call $calc (i32.const 1) (i64.const 30) (i64.const 20)) (i64.const 10))
  )
  (func $calc (param $op i32) (param $a i64) (param $b i64) (result i64)
    (local.get $a) (local.get $b)
    (if (param i64 i64) (result i64)
      (i32.eqz (local.get $op))
      (then (i64.add))
      (else (i64.sub))
    )
  )
)
